var seconds = 0;
$(document).ready(function() {
   seconds = parseInt($('span.time').attr('id'));
   increaseTime();
});

function increaseTime() {
    setTimeout(increaseTime,1000);
    var localSeconds = seconds;
    var hours = parseInt(localSeconds / 3600);
    localSeconds = localSeconds % 3600;
    var minutes = parseInt(localSeconds / 60);
    localSeconds = localSeconds % 60;
    if(localSeconds < 10) {
        localSeconds = '0'+localSeconds;
    }
    if(minutes < 10) {
        minutes = '0'+minutes;
    }
    if(hours < 10) {
        hours = '0'+hours;
    }
    $('span.time').text(hours+':'+minutes+':'+localSeconds);
    seconds = seconds + 1;
}
